查看原文
其他

FreeBSD也要 “锈化”?

OSC OSC开源社区 2024-01-30
FreeBSD 开发者正在考虑允许在 FreeBSD 基础系统中使用 Rust 编程语言的好处和成本。
https://lists.freebsd.org/archives/freebsd-hackers/2024-January/002823.html
邮件写道,在 FreeBSD 基础系统使用 Rust 的主要缺点是构建时间加倍。这是因为需要编译基于 LLVM 的 Rustc 编译器和 Rust 的所有附加功能,这些操作使得基础系统的构建时间大约是当前的两倍。
如果 FreeBSD 基础系统采用了 Rust,开发者可以重新 Rust 重写许多组件 —— 而不是使用 C++,例如 ZFS 守护进程 (zfsd)、重写 devd、WiFi 用户空间代码也可以受益于用 Rust 编写,等等。列举部分如下:

* ctl-exporter (I started this, but discovered that the CTL stats API is
  unstable, so it can't live in ports.  Instead, I had to do it in C).

  https://github.com/freebsd/freebsd-src/commit/1a7f22d9c211f504f6c48a86401469181a67ec34


* fusefs tests.  Absolutely impossible to do in C.  I considered Rust, but went

  with C++ so they could live in base.  They are too closely coupled to

  fusefs(5) to live out-of-tree.

  https://github.com/freebsd/freebsd-src/tree/main/tests/sys/fs/fusefs


* devd.  Currently C++, but imp suggested a rewrite.

  https://github.com/freebsd/freebsd-src/tree/main/sbin/devd


* zfsd.  Currently C++, but I've long pondered a rewrite.  Using Rust would

  make it more testable.

  https://github.com/freebsd/freebsd-src/tree/main/cddl/usr.sbin/zfsd


* nscd.  Currently C, but confusing and with no test coverage.  I've

  contemplated a rewrite myself, but I don't want to do it in C.

  https://github.com/freebsd/freebsd-src/tree/main/usr.sbin/nscd


* The userland portion of the 802.11ac and Lightning stacks.  scottl suggested

  that these were good candidates for Rust.


* freebsd-kpi-r14-0 .  https://crates.io/crates/freebsd-kpi-r14-0



往期推荐



程序员因报告漏洞,被判罚2.4万元

2023 LLM技术报告——知名大模型应用

知名游戏开发者云风宣布开源基于Lua的自研游戏引擎Ant Engine




这里有最新开源资讯、软件更新、技术干货等内容

点这里 ↓↓↓ 记得 关注✔ 标星⭐ 哦


继续滑动看下一个

FreeBSD也要 “锈化”?

向上滑动看下一个

您可能也对以下帖子感兴趣

文章有问题?点此查看未经处理的缓存